import request from "@/utils/request";

// 首页轮播图
export const getHomeSwiper = () => {
  return request.get('/home/swiper'); 
}

// 首页租房小组
export const getRentGroup = (id) => {
  return request.get('/home/groups', {
    params:{id}
  })
}

// 获取城市列表
export const getCityList = (data) => {
  return request.get('/area/city', { params: { level: data } })
}

// 获取热门城市
export const getHotCityList = (data) => {
  return request.get('/area/hot')
}

// 发布房源所需条件
export const goRentList = () => {
  return request.get('/houses/params')
}

// 发布房源
export const postRent = (data) => {
  return request.post('/user/houses',data)
}

// 上传房屋图像
export const postRentimg = (data) => {
  return request.post('/houses/image',data)
}

// 根据城市名获取id
export const getCityId = (data) => {
  return request.get('/area/info', {
    params:{name:data}
  })
}

// 小区关键词查询
export const searchCommunity = (data) => {
  return request.get('/area/community', {
    params:data
  })
}

// 获取房屋查询条件
export const searchConditions = (id) => {
  return request.get('/houses/condition', {
    params:{id}
  })
}